package com.lds.config.center.server.business.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lds.config.center.server.business.item.entity.Item;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * Mapper 接口
 *
 * @author lidongsheng
 * @since 2025-06-30
 */
public interface ItemMapper extends BaseMapper<Item> {
    @Select("select id from item where namespace_id = #{namespaceId} and name = #{name}")
    Long getItemIdByNamespaceIdAndName(Long namespaceId, String name);

    @Select("select name,value from item where namespace_id = #{namespaceId}")
    List<Map<String, String>> getAllItemByNamespaceId(Long namespaceId);
}

